home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / XMPlayer-library / Examples / Asm / test.s
Encoding:
Text File  |  2001-04-17  |  1.9 KB  |  86 lines

  1. ;This program explains how to use xmplayer.library
  2. ;Author: CruST/Amnesty^Humbug
  3. ;Date: 17.04.2001
  4. ;Library coded by CruST / Amnesty^.humbug.
  5. ;Released by .humbug. 17.01.2001
  6. ;Library based on the PS3M source 
  7. ;Copyright (c) Jarno Paananen a.k.a. Guru / S2 1994-96.
  8.  
  9.         incdir    include:
  10.         include    dos/dos.i
  11.         include    libraries/xmplayer.i
  12.         include    lvos.i
  13.  
  14.         section    code,code_p
  15.  
  16. Start
  17.         movem.l    d0-a6,-(sp)
  18.         
  19.         move.l    $4.w,a6
  20.         moveq    #0,d0
  21.         lea    dos_name,a1
  22.         jsr    _LVOOpenLibrary(a6)
  23.         tst.l    d0
  24.         beq    .error
  25.         move.l    d0,dos_base
  26.  
  27.         move.l    $4.w,a6
  28.         moveq    #0,d0
  29.         lea    xm_pl_name,a1
  30.         jsr    _LVOOpenLibrary(a6)
  31.         tst.l    d0
  32.         beq    .error_xmpl
  33.         move.l    d0,xmpl_base
  34.  
  35.         move.l    xmpl_base,a6
  36.         move.l    #xm_struct,a0
  37.         move.l    #module,XMPl_Cont(a0)        ;module pointer
  38.         move.l    #XM_STEREO14,XMPl_Mixtype(a0)    ;mixing type - see autodoc
  39.         move.l    #22000,XMPl_Mixfreq(a0)        ;mixing frequency - see autodoc
  40.         move.l    #2,XMPl_Vboost(a0)        ;volume boosting - see autodoc
  41.         move.l    #pr_name,XMPl_PrName(a0)    ;name for playing process - see autodoc
  42.         move.l    #0,XMPl_PrPri(a0)        ;playing process priority - see autodoc
  43.         jsr    _LVOXMPl_Init(a6)        ;inits a player structure
  44.         cmp.l    #FALSE,d0            ;if FALSE
  45.         beq    .ende                ;error
  46.  
  47.         move.l    xmpl_base,a6
  48.         jsr    _LVOXMPl_Play(a6)        ;I don't know... ;)
  49.         cmp.l    #FALSE,d0            ;if FALSE
  50.         beq    .fuck                ;error
  51.  
  52.         move.l    dos_base,a6
  53.         move.l    #20*TICKS_PER_SECOND,d1
  54.         jsr    _LVODelay(a6)            ;delay 20 secs and...
  55.  
  56.         move.l    xmpl_base,a6
  57.         jsr    _LVOXMPl_StopPlay(a6)        ;stop playing process
  58. .fuck        
  59.         move.l    xmpl_base,a6
  60.         jsr    _LVOXMPl_DeInit(a6)        ;guess what...    
  61. .ende
  62.         move.l    $4.w,a6
  63.         move.l    xmpl_base,a1
  64.         jsr    _LVOCloseLibrary(a6)
  65. .error_xmpl
  66.         move.l    $4.w,a6
  67.         move.l    dos_base,a1
  68.         jsr    _LVOCloseLibrary(a6)
  69.  
  70. .error
  71.         movem.l    (sp)+,d0-a6
  72.         moveq    #0,d0
  73.         rts
  74.         
  75. xmpl_base    dc.l    0
  76. dos_base    dc.l    0
  77.     
  78. xm_pl_name    dc.b    "xmplayer.library",0
  79. dos_name    dc.b    "dos.library",0
  80. pr_name        dc.b    "Amnesty XM-Player",0
  81. xm_struct    ds.b    XMPlayerInfo_SIZE
  82.  
  83.             section    xmmodule,data_p
  84.  
  85. module        incbin    "example.xm"
  86.